Skip to content

KAFKA-10357: Add explicit internal topic initialization for Kafka Str…#21892

Open
k-apol wants to merge 1 commit intoapache:trunkfrom
k-apol:KAFKA-10357-init-method
Open

KAFKA-10357: Add explicit internal topic initialization for Kafka Str…#21892
k-apol wants to merge 1 commit intoapache:trunkfrom
k-apol:KAFKA-10357-init-method

Conversation

@k-apol
Copy link
Copy Markdown
Contributor

@k-apol k-apol commented Mar 29, 2026

Implements KIP-698 to prevent silent data loss when internal topics (repartition/changelog) are accidentally deleted.

New public API:

  • KafkaStreams#init() and init(InitParameters) to explicitly create and validate internal topics before starting the application
  • InitParameters with fluent builder (following CloseOptions pattern): timeout(), withTimeout(), enableSetupInternalTopicsIfIncomplete()
  • StreamsConfig 'internal.topics.setup' config: 'automatic' (default, backward compatible) or 'manual' (requires init(), throws on missing topics during rebalance)

New exceptions (already merged via #19988):

  • MissingInternalTopicsException
  • MisconfiguredInternalTopicException
  • InternalTopicsAlreadySetupException

Behavioral changes:

  • In manual mode, makeReady() throws MissingInternalTopicsException when topics need creating during rebalance (instead of silently recreating them)
  • init() validates state (CREATED only), source topics, internal topic existence and configuration
  • INTERNAL_TOPIC_SETUP_CONFIG forwarded to consumer configs for the partition assignor

Reviewers: Matthias J. Sax matthias@confluent.io

…eams (KIP-698)

Implements KIP-698 to prevent silent data loss when internal topics
(repartition/changelog) are accidentally deleted.

New public API:
- KafkaStreams#init() and init(InitParameters) to explicitly create
  and validate internal topics before starting the application
- InitParameters with fluent builder (following CloseOptions pattern):
  timeout(), withTimeout(), enableSetupInternalTopicsIfIncomplete()
- StreamsConfig 'internal.topics.setup' config: 'automatic' (default,
  backward compatible) or 'manual' (requires init(), throws on missing
  topics during rebalance)

New exceptions (already merged via apache#19988):
- MissingInternalTopicsException
- MisconfiguredInternalTopicException
- InternalTopicsAlreadySetupException

Behavioral changes:
- In manual mode, makeReady() throws MissingInternalTopicsException
  when topics need creating during rebalance (instead of silently
  recreating them)
- init() validates state (CREATED only), source topics, internal topic
  existence and configuration
- INTERNAL_TOPIC_SETUP_CONFIG forwarded to consumer configs for the
  partition assignor

Reviewers: Matthias J. Sax <matthias@confluent.io>
@github-actions github-actions bot added triage PRs from the community streams labels Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

streams triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant